

import 'package:flutter/material.dart';
import 'package:ponydata_desk/pages/channel_item.dart';

import '../model/position_model.dart';
import '../res/positons30.dart';

class WaferSection extends StatefulWidget {
  const WaferSection({super.key});

  @override
  State<WaferSection> createState() => _WaferSectionState();
}

class _WaferSectionState extends State<WaferSection> {

 List<ChannelModel> positons =[];



 @override
 void initState() {
   super.initState();
   pos1.forEach((element) {
     positons.add(ChannelModel.fromJson(element));
   });
 }

 List<Widget> getTemBlocks() {
   List<Widget> items = [];

   // positons.forEach((element) {
   //    double x =  (element.x! + 75.0)/150*420;
   //    double y =  (element.y! + 75.0)/150*420;
   //    items.add(Positioned(left: x, top: y, child: Container(color: Colors.red,child: TemTitle(null),)));
   //
   // });

   return items;
 }


 @override
  Widget build(BuildContext context) {
    return Container(

        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage(
              "lib/res/images/card.png",
            ), // 背景图的网络链接
            fit: BoxFit.cover, // 背景图适应容器大小
          ),
        ),
        child:
        Stack(
          children: [

            // Positioned(left: 100, top: 100, child: TemTitle("22", 0)),
            // Positioned(left: 200, top: 400, child: TemTitle("22", 0)),

          ],
        ),);
    }
}
